package com.company.Link.student;

import java.util.*;

/**
 * @author 关敬元
 * @Description
 * @date 2019/11/28
 */
public class CollectionTest {
    public static void main(String[] args) {
        List<Integer> list = new ArrayList<Integer>();
        Integer []a = {10,11,2,80,97,79,56,22};
        list= Arrays.asList(a);
        Integer[]b=(Integer[]) list.toArray();
        System.out.println(list);
//        Collections.sort(list);
        Collections.sort(list, new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1-o2;
            }
        });
        System.out.println(list);
        System.out.println(Collections.max(list));
        System.out.println(Collections.min(list));
        System.out.println(Collections.synchronizedCollection(list));//线程安全
    }
}
